/**
 * cookieTools.js
 */
jQuery(function($) {

	window.getUserID = function() {
		return $.cookie('userId');
	}
	window.getUserIcon = function() {
		return $.cookie('userIcon');
	}
	window.getUserNickName = function() {
		return decodeURI($.cookie('userNickName'));
	}
	window.getURightJson = function() {
		var uRight = $.cookie('uRight');
		var jsonDate = eval("(" + uRight + ")");
		return jsonDate;

	}
	window.isClassManager = function(cid) {
		if (window.getURightJson().uarray.length != 0) {
			$.each(window.getURightJson().uarray, function(n, v) {
				if (v.ClassID) {
					return v.ClassID == cid ? true : false;
				} else {
					return false;
				}
			});
		} else {
			return false;
		}

	}
	window.isSuperManager = function() {
		if (window.getURightJson().uarray.length != 0) {
			$.each(window.getURightJson().uarray, function(n, v) {
				if (v.ClassID) {
					return v.ClassID == 0 ? true : false;
				} else {
					return false;
				}
			});
		} else {
			return false;
		}
	}
});
